#pragma once
#include "subframe.h"

#include <QString>
#include <QStringList>
class QTreeWidget;
class QTreeWidgetItem;
class QTextEdit;
class QMenu;

class FormNote :
	public SubFrame
{
	Q_OBJECT
public:
	FormNote(QWidget * parent = 0,	Qt::WFlags f = 0);
	~FormNote(void);
	void fileNew(void);
private:
	static const QString m_strRoot;
	QTreeWidget*	m_treeWidget;
	QTextEdit*		m_textEdit;
	QString			m_strCurFileName;
	bool			m_modified;
	QMenu*			m_menuPop;

private slots:
	void treeClicked(QTreeWidgetItem* item, int column);
	void showTreeMenu(const QPoint & pos);
	void CreateNote();
	void CreateClass();
	void RemoveNote();
	void textChanged(void);
private:
	void loadFile(void);
	bool setCurFileName(QString& name);
	void refreshList(void);
	void save(void);
	void fileDelete(void);
	void ShowDir(QTreeWidgetItem* pParent, const QString& path, QTreeWidget* pTree = NULL);
};
